<template>
	<view>
		<commonHeader :title="titles"></commonHeader>
		<view class="gHeadbox"></view>
		<view class="box">
			<view class="title">
				{{content.title}}
			</view>
			<view class="time">
				{{content.createTime}}
			</view>
			<view class="cont" v-html="content.content">
			</view>
		</view>
	</view>
</template>

<script>
	import {
		noticeItem
	} from '@/api/home.js'
	export default {
		data() {
			return {
				content: '',
				ntype: '',
				titles: '',
			}
		},
		onLoad: function(option) { //option为object类型，会序列化上个页面传递的参数
			console.log(option.tid); //打印出上个页面传递的参数。
			if (option.tid) {
				this.ntype = option.tid;
				this.titles = option.names
			}
		},
		mounted() {
			this.fncontent()
		},
		methods: {
			fncontent() {
				console.log(this.ntype)
				noticeItem('', this.ntype).then(res => {
					if (res.code == 200) {
						console.log(res)
						this.content = res.data
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.box {
		padding: 20rpx 40rpx;
		box-sizing: border-box;

		.title {
			color: #e5bbff;
			font-size: 32rpx;
			font-weight: 900;
			font-family: "阿里巴巴普惠体";
		}
		.time{
			 color: #baa7c6;
			 font-size: 22rpx;
			 font-weight: 400;
			 margin: 20rpx 0;
		}
		.cont{
			width: 100%;
			border-top: 2rpx solid #e9c4ff;
			padding: 30rpx 0;
			box-sizing: border-box;
		}
	}
</style>